package com.ddyx.service.product.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 类目
 * </p>
 *
 * @author agula
 * @since 2019-08-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("p_goods_category")
public class GoodsCategory extends Model<GoodsCategory> {

    private static final long serialVersionUID=1L;

    /**
     * 类目ID
     */
    @TableId(value = "category_id", type = IdType.AUTO)
    private Integer categoryId;

    /**
     * 类目编码
     */
    private String categoryCode;

    /**
     * 父级类目编码
     */
    private String parentCode;

    /**
     * 类目名称
     */
    private String categoryName;

    /**
     * 显示名称
     */
    private String displayName;

    /**
     * 类目层级
     */
    private Integer categoryLevel;

    /**
     * 是否末级,0：否，1：是
     */
    private Integer isLeaf;

    /**
     * 是否禁用,0：否（禁用状态），1：是（启用状态），默认0
     */
    private Integer isLocked;

    /**
     * 是否删除,0：否，1：是，默认0
     */
    private Integer isDeleted;

    /**
     * 排序号
     */
    private Integer sortNo;

    /**
     * 创建时间
     */
    private LocalDateTime gmtCreate;

    /**
     * 修改时间
     */
    private LocalDateTime gmtModified;

    @Override
    protected Serializable pkVal() {
        return this.categoryId;
    }

    @Override
    public String toString() {
        return "GoodsCategory{" +
        "categoryId=" + categoryId +
        ", categoryCode=" + categoryCode +
        ", parentCode=" + parentCode +
        ", categoryName=" + categoryName +
        ", displayName=" + displayName +
        ", categoryLevel=" + categoryLevel +
        ", isLeaf=" + isLeaf +
        ", isLocked=" + isLocked +
        ", isDeleted=" + isDeleted +
        ", sortNo=" + sortNo +
        ", gmtCreate=" + gmtCreate +
        ", gmtModified=" + gmtModified +
        "}";
    }
}
